#ifndef __ENGINE_H__
#define __ENGINE_H__

#include <wiisprite.h>
#include <vector>

#include "Entity.h"

using namespace wsp;

/*
 *  The Engine will also manage the Layer Manager.
 */
class Engine
{
public:
	Engine();
	/*!Param maxEntities: number of entities to pass to layer manager.
	 *
	 */
	Engine(u32 maxEntities);  
	~Engine();
	
	void Update();
	
	
	
	
	// Entity management
		
	// Transfers ownership of the entity to the Engine.  The engine will dealocate it.
	// The entity is placed in the newEntityList, and will be merged with the entityList at the beginning 
	// of each update()
	void AddEntity(Entity *ent);

protected:	
	void MergeEntityLists();
	void ClearEntities ();
	
	


public:
	
	std::vector<Entity *> entityList, newEntityList;
	
	LayerManager layerManager;


};
#endif//__ENGINE_H__